package com.jzo2o.customer.service;

import com.jzo2o.api.customer.dto.response.AddressBookResDTO;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.domain.AddressBook;
import com.jzo2o.customer.model.dto.request.AddressBookPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.AddressBookUpsertReqDTO;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 地址薄 服务类
 * </p>
 *
 * @author itcast
 * @since 2023-07-06
 */
public interface IAddressBookService extends IService<AddressBook> {

    /**
     * 根据用户id和城市编码获取地址
     *
     * @param userId 用户id
     * @param cityCode 城市编码
     * @return 地址编码
     */
    List<AddressBookResDTO> getByUserIdAndCity(Long userId, String cityCode);



    /**
     * //n("查询地址簿信息")
     * @param request
     * @param addressBookPageQueryReqDTO
         *     ApiModelProperty("页码数")
         *     private Long pageNo = 1L;
         *     ApiModelProperty("每页条数")
         *     private Long pageSize = 10L;
         *     ApiModelProperty("排序字段1")
         *     private String orderBy1;
         *     ApiModelProperty("排序字段1是否升序")
         *     private Boolean isAsc1 = false;
         *     ApiModelProperty("排序字段2，排序顺序排在排序字段1后边，如果排序字段1未设置，该字段也可以排序")
         *     private String orderBy2;
         *     ApiModelProperty("排序字段2是否升序")
     *     private Boolean isAsc2 = false;
     * @return
     */
    PageResult<AddressBook> findAddressBook(HttpServletRequest request, AddressBookPageQueryReqDTO addressBookPageQueryReqDTO);

    //编辑地址回显数据")
    AddressBook getAddressBook(Long id);

    //("设置默认地址 1默认  0 非默认")
    AddressBook defaultAddress(Long id, int flag);

    //("添加地址簿信息")
    void addAddressBook(HttpServletRequest request,AddressBookUpsertReqDTO addressBookUpsertReqDTO);

    //编辑地址信息更新")
    AddressBook updateAddress(Long id,AddressBook addressBook);

   // n("删除地址")
    void delete(String[] ids);
}
